class SprintBacklogColumnsController < ApplicationController
  def show
      @proj_id = current_user.current_project_id
      @columns = SprintBacklogColumn.where("project_id" => @proj_id)
      render :layout => nil
  end
  
  def new
    @proj_id = params[:items].split(",")[0];
    @colname = params[:items].split(",")[1].gsub(/ /, "--leer--");
    
    @anzahl = SprintBacklogColumn.where("project_id" => @proj_id).count
    @anzahl = @anzahl+1

    @sbc = SprintBacklogColumn.new
    @sbc.project_id = @proj_id
    @sbc.column_position = @anzahl
    @sbc.name = @colname
    if @sbc.save
      render :layout => nil
    else
      render :text => "error"
    end
  end
end
